<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="sp" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="s" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>网站首页</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="charset" content="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/layui/css/layui.css"
	media="all">
<link
	href="${pageContext.request.contextPath }/js/Datepicker20161107/css/foundation-datepicker.css"
	rel="stylesheet" type="text/css">
<style type="text/css">
td img {
	display: block;
}

td img {
	display: block;
}

td img {
	display: block;
}

td img {
	display: block;
}

td img {
	display: block;
}

td img {
	display: block;
}

.STYLE4 {
	font-size: 14px
}

td img {
	display: block;
}
</style>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-3.1.0.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/layui/layui.js"
	charset="utf-8"></script>
<script
	src="${pageContext.request.contextPath }/js/Datepicker20161107/js/foundation-datepicker.js"></script>
<script
	src="${pageContext.request.contextPath }/js/Datepicker20161107/js/locales/foundation-datepicker.zh-CN.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/My97DatePicker/WdatePicker.js"></script>
<%-- <script>
		$('#demo-1').fdatepicker();
		$('#demo-2').fdatepicker({
			format: 'yyyy-mm-dd hh:ii',
			pickTime: true
		});
		$('#demo-3').fdatepicker();

		var nowTemp = new Date();
		var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
		var checkin = $('#dpd1').fdatepicker({
			onRender: function (date) {
				return date.valueOf() < now.valueOf() ? 'disabled' : '';
			}
		}).on('changeDate', function (ev) {
			if (ev.date.valueOf() > checkout.date.valueOf()) {
				var newDate = new Date(ev.date)
				newDate.setDate(newDate.getDate() + 1);
				checkout.update(newDate);
			}
			checkin.hide();
			$('#dpd2')[0].focus();
		}).data('datepicker');
		var checkout = $('#dpd2').fdatepicker({
			onRender: function (date) {
				return date.valueOf() <= checkin.date.valueOf() ? 'disabled' : '';
			}
		}).on('changeDate', function (ev) {
			checkout.hide();
		}).data('datepicker');
</script> --%>
<script type="text/javascript">
	$(function() {
		var url = "${pageContext.request.contextPath }/getStartplace";
		$("#startPlace").blur(
				function() {
					$("#endPlace").text("");
					var startPlace = $("#startPlace").val();
					url = "${pageContext.request.contextPath }/getEndplace";
					$.post(url, {
						"startPlace" : startPlace
					}, function(data) {
						var json = eval(data);
						for (var i = 0; i < json.length; i++) {

							$("#endPlace").append(
									"<option value="+json[i]+">" + json[i]
											+ "</option>");
						}
					});
				});

		$("#chaxun").click( function() {
			var start = $("#startPlace").val();
			var endplace = $("#endPlace").val();
			var date = $("#Wdate").val();
			if(start == ""){
				alert("请选择出发城市！！！");
				return false;
			}
			if(endplace == ""){
				alert("请选择目的地！！！")
				return false;
			}
			if(date == ""){
				alert("请选择乘车日期！！！");
				return false;
			}
			url = "${pageContext.request.contextPath }/getAllcarOrder";
			$.post(url, {
				"start" : start,
				"endplace" : endplace,
				"time" : date
			}, function(data) {
				if(data.length < 1){
					alert("暂无车票信息！！！")
				}
				$.each(data,
						function(index, content) {
							$("#cartable tr:not(:first):not(:last)").remove();
							$("#cartable").append(
									"<tr><td>" + content.carOrder
											+ "</td>" +
											/* "<td><fmt:formatDate value="+content.startTime +" pattern='yyyy-MM-dd HH:mm:ss' /></td>"+ */
											"<td>" + content.startTime
											+ "</td>" + "<td>"
											+ content.carModel
											+ "</td>" + "<td>"
											+ content.roadLong
											+ "</td>" + "<td>"
											+ content.ticketPrice
											+ "</td>" + "<td>"
											+ content.vainChair
											+ "</td></tr>");
						});
			});
		});
	});
</script>
<script type="text/javascript">
	$(function() {
		$("#name").focus(function() {
			$("#span1").text("");
		});
		$("#password").focus(function() {
			$("#span1").text("");
		});
	});
</script>
<script type="text/javascript">
	function passMessage() {
		var a = document.getElementById("name").value;
		var b = document.getElementById("password").value;
		var sel = "";
		if (a == "") {
			alert("用户名不能为空！！！");
			return false;
		}
		if (b == "") {
			confirm("请输入密码！！！");
			return false;
		}
		for (var i = 0; i < document.getElementsByName("identity").length; i++) {
			if (document.getElementsByName("identity")[i].checked) {
				sel = document.getElementsByName("identity")[i].value;
			}
		}
		if (sel == "") {
			alert("请选择身份！");
			return false;
		}
		return true;
	}
</script>
</head>
<body>
	<table width="788" border="0" align="center">
		<tr>
			<td height="158" colspan="2" valign="top">
				<table border="0" cellpadding="0" cellspacing="0" width="780">
					<tr>
						<td colspan="11"><img name="indexLOGO_r1_c1"
							src="imags/indexLOGO_r1_c1.jpg" width="780" height="178"
							border="0" id="indexLOGO_r1_c1" alt="" /></td>
						<td><img src="imags/spacer.gif" width="1" height="178"
							border="0" alt="" /></td>
					</tr>
					<tr>
						<td rowspan="2"><img name="indexLOGO_r2_c1"
							src="imags/indexLOGO_r2_c1.jpg" width="198" height="22"
							border="0" id="indexLOGO_r2_c1" alt="" /></td>
						<td><a href="index.jsp" target="_top"> <img name="indexLOGO_r2_c2"
								src="imags/indexLOGO_r2_c2.jpg" width="69" height="17"
								border="0" id="indexLOGO_r2_c2" alt="" />
						</a></td>
						<td rowspan="2"><img name="indexLOGO_r2_c3"
							src="imags/indexLOGO_r2_c3.jpg" width="44" height="22" border="0"
							id="indexLOGO_r2_c3" alt="" /></td>
						<td><a href="ticketLook" target="_top"> <img name="indexLOGO_r2_c4"
								src="imags/indexLOGO_r2_c4.jpg" width="70" height="17"
								border="0" id="indexLOGO_r2_c4" alt="" />
						</a></td>
						<td rowspan="2"><img name="indexLOGO_r2_c5"
							src="imags/indexLOGO_r2_c5.jpg" width="57" height="22" border="0"
							id="indexLOGO_r2_c5" alt="" /></td>

						<td><a href="bookTicket" target="_top"><img name="indexLOGO_r2_c6"
								src="imags/indexLOGO_r2_c6.jpg" width="72" height="17"
								border="0" id="indexLOGO_r2_c6" alt="" /></a></td>

						<td rowspan="2"><img name="indexLOGO_r2_c7"
							src="imags/indexLOGO_r2_c7.jpg" width="55" height="22" border="0"
							id="indexLOGO_r2_c7" alt="" /></td>

						<td><a href="tuiPiao" target="_top"><img name="indexLOGO_r2_c8"
								src="imags/indexLOGO_r2_c8.jpg" width="72" height="17"
								border="0" id="indexLOGO_r2_c8" alt="" /></a></td>

						<td rowspan="2"><img name="indexLOGO_r2_c9"
							src="imags/indexLOGO_r2_c9.jpg" width="48" height="22" border="0"
							id="indexLOGO_r2_c9" alt="" /></td>

						<td><a href="leaveMessage" target="_top"> <img name="indexLOGO_r2_c10"
								src="imags/indexLOGO_r2_c10.jpg" width="70" height="17"
								border="0" id="indexLOGO_r2_c10" alt="" /></a></td>
						<td rowspan="2"><img name="indexLOGO_r2_c11"
							src="imags/indexLOGO_r2_c11.jpg" width="25" height="22"
							border="0" id="indexLOGO_r2_c11" alt="" /></td>
						<td><img src="imags/spacer.gif" width="1" height="17"
							border="0" alt="" /></td>
					</tr>
					<tr>
						<td><img name="indexLOGO_r3_c2"
							src="imags/indexLOGO_r3_c2.jpg" width="69" height="5" border="0"
							id="indexLOGO_r3_c2" alt="" /></td>
						<td><img name="indexLOGO_r3_c4"
							src="imags/indexLOGO_r3_c4.jpg" width="70" height="5" border="0"
							id="indexLOGO_r3_c4" alt="" /></td>
						<td><img name="indexLOGO_r3_c6"
							src="imags/indexLOGO_r3_c6.jpg" width="72" height="5" border="0"
							id="indexLOGO_r3_c6" alt="" /></td>
						<td><img name="indexLOGO_r3_c8"
							src="imags/indexLOGO_r3_c8.jpg" width="72" height="5" border="0"
							id="indexLOGO_r3_c8" alt="" /></td>
						<td><img name="indexLOGO_r3_c10"
							src="imags/indexLOGO_r3_c10.jpg" width="70" height="5" border="0"
							id="indexLOGO_r3_c10" alt="" /></td>
						<td><img src="imags/spacer.gif" width="1" height="5"
							border="0" alt="" /></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td width="218" height="0" valign="top" bgcolor="#EDEDED">
				<table width="0" height="559" border="0">
					<tr height="210" align="center" valign="top">
						<td width="218" height="210" align="center" valign="top">
							<form name="form1" method="post"
								action="${pageContext.request.contextPath }/dengLu">
								<table width="100%" height="201" border="0">
									<tr>
										<td align="center" valign="top" bgcolor="#CD0102"><img
											name="userLogin" src="imags/userLogin.jpg" width="218"
											height="43" border="0" id="userLogin" alt="" /></td>
									</tr>
									<s:if test="${sessionScope.name == null}">
										<tr>
											<td align="center" height="50"><input type="text"
												name="name" id="name" lay-verify="required"
												placeholder="请输入用户名" autocomplete="off" class="layui-input" />
											</td>
										</tr>
										<tr>
											<td align="center"><input type="password"
												name="password" id="password" lay-verify="required"
												placeholder="请输入密码" class="layui-input" /> <span id="span1"
												style="width: 218px; height: 21px; color: #EE0000; font-size: 12px">${requestScope.message}</span>
											</td>
										</tr>
										<tr>
											<td height="30" align="center" valign="middle"><input
												type="radio" name="identity" value="normal" />普通用户&nbsp; <input
												type="radio" name="identity" value="manager" />管理员</td>
										</tr>
										<tr>
											<td height="20" valign="top">
												<table width="198" border="0">
													<tr>
														<td width="100" height="38" align="center">
															<button type="button" name="clear" id="clear"
																class="layui-btn layui-btn-primary layui-btn-radius"
																style="height: 40px" onClick="return reset()">重置</button>
														</td>
														<td width="88" align="center">
															<button name="submit" id="submit"
																class="layui-btn layui-btn-primary layui-btn-radius"
																style="height: 40px" onClick="return passMessage();">登录</button>
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</s:if>
									<s:if test="${sessionScope.name != null}">
										<tr>
											<td height="50" align="left"><span>欢迎回来，${sessionScope.name}</span>&nbsp;&nbsp;&nbsp;&nbsp;
												<a href="${pageContext.request.contextPath }/loginOut">[退出]</a>
											</td>
										</tr>
										<tr>
											<td align="center" height="50"></td>
										</tr>
										<tr>
											<td height="30" align="center" valign="middle"></td>
										</tr>
										<tr>
											<td height="20" valign="top"></td>
										</tr>
										<tr>
											<td></td>
										</tr>
									</s:if>
								</table>
							</form>
						</td>
					</tr>
					<tr height="210" align="center" valign="top">
						<td width="218" height="210" align="center" valign="top">
							<table width="100%" height="201" border="0">
								<tr>
									<td align="center" bgcolor="#CD0102" width="228px"><img
										name="serviceALL_r1_c1" src="imags/serviceALL_r1_c1.jpg"
										width="218" height="43" border="0" id="serviceALL_r1_c1"
										alt="" /></td>
								</tr>
								<tr>
									<td align="center"><a href="zhuche" target="_top">
											<button style="width: 220px"
												class="layui-btn layui-btn-primary">会员注册</button>
									</a></td>
								</tr>
								<tr>
									<td align="center"><a href="userManage" target="_top">
											<button style="width: 220px"
												class="layui-btn layui-btn-primary">用户管理</button>
									</a></td>
								</tr>
								<tr>
									<td align="center"><a href="ticketLook" target="_top"><button
												style="width: 220px" class="layui-btn layui-btn-primary">车票信息</button>
									</a></td>
								</tr>
								<tr>
									<td align="center"><a href="bookTicket" target="_top"><button
												style="width: 220px" class="layui-btn layui-btn-primary">在线售票</button>
									</a></td>
								</tr>
								<tr>
									<td align="center"><a href="listTicketSaled.action"
										target="_top"><button style="width: 220px"
												class="layui-btn layui-btn-primary">查询售票情况</button> </a></td>
								</tr>
								<tr>
									<td align="center"><a href="tuiPiao" target="_top"><button
												style="width: 220px" class="layui-btn layui-btn-primary">退票管理</button>
									</a></td>
								</tr>
								<tr>
									<td align="center"><a href="leaveMessage" target="_top"><button
												style="width: 220px" class="layui-btn layui-btn-primary">发表留言</button>
									</a></td>
								</tr>
								<tr>
									<td align="center"><a href="lookMessage.action"
										target="_top"><button style="width: 220px"
												class="layui-btn layui-btn-primary">查看留言信息</button> </a></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
			<td width="556" valign="top"><table width="556" height="509"
					border="0">
					<tr>
						<td width="21" height="34" valign="top">&nbsp;</td>
						<td width="37" valign="middle"><img
							src="imags/awarr_2003001[1].gif" width="35" height="17"></td>
						<td width="164" valign="middle"><span class="STYLE5">在线查询</span></td>
						<td width="316" valign="top">&nbsp;</td>
					</tr>
					<tr>
						<td height="182" colspan="4" valign="top"><sp:form
								action="ticketLook" method="post" modelAttribute="carSchema">
								<table width="489" height="173" border="0" cellpadding="0px"
									cellspacing="10px">
									<tr>
										<td>&nbsp;</td>
										<td width="98" height="29"><span class="STYLE4">出发城市：</span></td>
										<td width="188" align="left"><select name="startStation"
											id="startPlace" id="startPlace"
											style="width: 210px; height: 40px">
												<s:forEach items="${requestScope.startplace}" var="s">
													<option value="${s }">${s}</option>
												</s:forEach>
										</select></td>
										<td width="26">&nbsp;</td>
										<td width="22">&nbsp;</td>
									</tr>
									<tr>
										<td>&nbsp;</td>
										<td height="27"><span class="STYLE4">目的城市：</span></td>
										<td align="left"><select name="finalStation"
											style="width: 210px; height: 40px" id="endPlace">
										</select></td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									<tr>
										<td>&nbsp;</td>
										<td height="30"><span class="STYLE4">乘车日期：</span></td>
										<td height="30" align="left"><input type="text"
											name="takeOffTime" class="layui-input" lay-verify="required"
											id="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
											placeholder="请选择出发时间" /></td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									<tr>
										<td>&nbsp;</td>
										<td height="46" colspan="3"><table width="296"
												height="37" border="0">
												<tr>
													<td width="75" height="33">&nbsp;</td>
													<td width="113" valign="bottom">
														<!-- <button name="button" id="chaxun"
															class="layui-btn layui-btn-primary layui-btn-radius">点击查询</button> -->
														<input type="button" id="chaxun" value="点击查询"
														class="layui-btn layui-btn-primary layui-btn-radius" />
													</td>
													<td width="94">&nbsp;</td>
												</tr>
											</table></td>
										<td>&nbsp;</td>
									</tr>
								</table>
							</sp:form></td>
					</tr>
					<tr>
						<td colspan="4" valign="top">
							<table border="0" width="100%" align="center" cellpadding="0"
								id="cartable" cellspacing="1" bgcolor="#dfdfdf">

								<tr>
									<td width="14%" height="26" bgcolor="#CC6600"><span
										class="STYLE9">车次</span></td>

									<td width="28%" bgcolor="#CC6600"><span class="STYLE9">发车时间</span>
									</td>

									<td width="12%" bgcolor="#CC6600"><span class="STYLE9">车型</span>
									</td>

									<td width="20%" bgcolor="#CC6600"><span class="STYLE9">里程（</span><span
										class="STYLE12">公里</span><span class="STYLE9">）</span></td>

									<td width="15%" bgcolor="#CC6600"><span class="STYLE9">票价</span><span
										class="STYLE11">（元）</span></td>

									<td width="11%" bgcolor="#CC6600"><span class="STYLE9">余票数</span>
									</td>
								</tr>


							</table>
						</td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td height="41" colspan="2" align="center" valign="top"><hr
					size="2" color="#CC6666">
				<p align="center">
					<span class="STYLE4">华育国际J27班第四小组版权所有 Copyright © 2017-2020.
						All Rights Reserved.</span>
				</p></td>
		</tr>
		<tr>
			<td height="23" colspan="2" valign="top"><hr size="15"
					color="#FF3333"></td>
		</tr>
	</table>
	<br>
</body>
</html>
